package com.example.xyxwebbackend001.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.xyxwebbackend001.model.entity.TouristContent;
import com.example.xyxwebbackend001.model.entity.TradCraftContent;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TouristContentMapper extends BaseMapper<TouristContent> {
    @Insert("<script>" +
            "INSERT INTO tourist_content (to_id, type, content, list_items, file_path) VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(#{item.toId}, #{item.type}, #{item.content}, #{item.listItems}, #{item.filePath})" +
            "</foreach>" +
            "</script>")
    void batchTouristInsert(@Param("list") List<TouristContent> contents);
}
